import { myPlugin } from "./MyPlugin"

export const plugins = [myPlugin]

export const state = () => ({
    list: []
  })

//通过this.$store.commit调用
export const mutations = {
    add(state, text) {
        console.log(text)
        state.list.push({
        text,
        done: false
        })
    },
    remove(state, { todo }) {
        state.list.splice(state.list.indexOf(todo), 1)
    },
    toggle(state, todo) {
        console.log(todo);
        todo.done = !todo.done
    }
}